/**
 *
 */
package com.googlecode.bip.entity;

import java.sql.Timestamp;
import java.util.Comparator;
import java.util.Date;

/**
 * Compare 2 Timestamp
 * @author Claude CHOISNET
 */
class TimestampComparator implements Comparator<Timestamp>
{
    /**
     * Compare 2 Timestamp objects
     * @param i0 first Integer, could be null
     * @param i1 second Integer, could be null
     * @return 0 if Integer have same value or are both null
     */
    public static final int compareTimestamp( final Timestamp i0, final Timestamp i1 )
    {
        return StringComparator.compareObject( (Date)i0, (Date)i1 );
    }

    @Override
    public int compare( final Timestamp i0, final Timestamp i1 )
    {
        return compareTimestamp( i0, i1 );
    }

}
